﻿@model PagedList<ADZ_JingjiaBaomingOrder>
@{
    ViewBag.Title = "竞价报名列表";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";

    JingjiaQueryModel paramModel = new JingjiaQueryModel();
    if (ViewBag.paramModel != null)
    {
        paramModel = (JingjiaQueryModel)ViewBag.paramModel;
    }
    ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
    Dictionary<string, string> dc = new Dictionary<string, string>();
}

<form id="S_Form" class="form-inline definewidth m20"  method="get">
    <div class="form_query">
        <div>
            <input type="hidden" name="jingjia_config_id" id="jingjia_config_id" class="abc input-default" placeholder="" value="@paramModel.jingjia_config_id">&nbsp;
        </div>
        <div>
            是否付款：
            <select id="jingjia_satus" name="jingjia_satus">
                <option value="-10">全部</option>
                @{
                    dc = new Dictionary<string, string>();
                    dc.Add("0", "未支付");
                    dc.Add("1", "已支付");                    
                }
                @HtmlPagerHelper.ShowSelectOpton(dc, paramModel.jingjia_satus.ToString());
            </select>&nbsp;
        </div>

        <div>
            @{Html.RenderPartial(Url.Content("~/Views/Common/PageSize.cshtml"), paramModel);}
        </div><div>
            <button type="submit" class="btn btn-primary" id="formsubmit">查询</button>
            <button type="button" backpageid="jingjia/getconfiglist" class="btn btn-success" name="backid" id="backid">返回</button>
        </div>
    </div>
    <table class="table table-bordered table-hover definewidth m10">
        <thead>
            <tr>
                <th>竞价名称</th>
                <th>用户昵称</th>
                <th>报名手机</th>
                <th>报名UID</th>
                <th>报名时间</th>
                <th>报名保证金</th>
                <th>备注信息</th>
                <th>报名状态</th>
            </tr>
        </thead>
        @if (Model != null && Model.Count != 0)
        {
            int index = 0;
            foreach (var m in Model)
            {
                index++;
                var userinfo = dbcontext.ADZ_MemberMaster.FirstOrDefault(t => t.uid == m.uid);
                if (userinfo == null)
                {
                    continue;
                }

                var jingjia_config = dbcontext.ADZ_JingjiaConfig.FirstOrDefault(t => t.jingjia_config_id == m.jingjia_config_id);
                if (jingjia_config == null)
                {
                    continue;
                }

                <tr class="@HtmlPagerHelper.TrClass(index)">
                    <td>@jingjia_config.jingjia_config_name</td>
                    <td>
                        <a href="/account/defailinfo?uid=@userinfo.uid">@userinfo.member_name</a>
                    </td>
                    <td>
                        @userinfo.account_mobile
                    </td>
                    <td>
                        @userinfo.uid
                    </td>
                    <td>
                        @m.create_time.ToString(1)
                    </td>
                    <td>@m.order_amt.ToString("N2")</td>
                    <td>@m.remark</td>
                    <td>
                        @if (m.is_succ == 1)
                        {
                            <info class="green">已支付</info>

                            if (m.order_status == 1)
                            {
                                <info>报名成功</info>
                            }
                            if (m.order_status == 2)
                            {
                                <info class="green">已退款</info>
                            }
                        }
                        else
                        {
                            <info>未支付</info>
                        }
                    </td>
                </tr>
            }
        }
    </table>
    <div class="inline pull-left total">
        总行数：@ViewData["AllCount"]
    </div>
    <div class="inline pull-right page">
        @if (Model != null)
        {
            @Html.Pager(Model, HtmlPagerHelper.BasePagerOption)
        }
    </div>
</form>